home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993 April: Penguin on DISC / ADC Developer CD (1993-04) (''Penguin On DISC'')_iso / Dev.CD Apr 93.iso / Utilities / MPW Interfaces 7.1 Beta / PInterfaces / Controls.p < prev    next >
Encoding:
Text File  |  1992-08-28  |  5.4 KB  |  203 lines  |  [TEXT/MPS ]

  1.  
  2. {
  3. Created: Sunday, September 15, 1991 at 10:07 PM
  4.  Controls.p
  5.  Pascal Interface to the Macintosh Libraries
  6.  
  7.   Copyright Apple Computer, Inc. 1985-1991
  8.   All rights reserved
  9. }
  10.  
  11.  
  12. {$IFC UNDEFINED UsingIncludes}
  13. {$SETC UsingIncludes := 0}
  14. {$ENDC}
  15.  
  16. {$IFC NOT UsingIncludes}
  17.  UNIT Controls;
  18.  INTERFACE
  19. {$ENDC}
  20.  
  21. {$IFC UNDEFINED UsingControls}
  22. {$SETC UsingControls := 1}
  23.  
  24. {$I+}
  25. {$SETC ControlsIncludes := UsingIncludes}
  26. {$SETC UsingIncludes := 1}
  27. {$IFC UNDEFINED UsingQuickdraw}
  28. {$I $$Shell(PInterfaces)Quickdraw.p}
  29. {$ENDC}
  30. {$SETC UsingIncludes := ControlsIncludes}
  31.  
  32. CONST
  33. pushButProc = 0;
  34. checkBoxProc = 1;
  35. radioButProc = 2;
  36. useWFont = 8;
  37. scrollBarProc = 16;
  38. inButton = 10;
  39. inCheckBox = 11;
  40. inUpButton = 20;
  41. inDownButton = 21;
  42. inPageUp = 22;
  43. inPageDown = 23;
  44. inThumb = 129;
  45.  
  46. popupMenuProc = 1008;                { 63 * 16 }
  47. popupFixedWidth = $0001;            { popup menu CDEF variation codes }
  48. popupUseAddResMenu = $0004;
  49. popupUseWFont = $0008;
  50. popupTitleBold = $00000100;            { Popup Title characteristics }
  51. popupTitleItalic = $00000200;
  52. popupTitleUnderline = $00000400;
  53. popupTitleOutline = $00000800;
  54. popupTitleShadow = $00001000;
  55. popupTitleCondense = $00002000;
  56. popupTitleExtend = $00004000;
  57. popupTitleNoStyle = $00008000;
  58. popupTitleLeftJust = $00000000;
  59. popupTitleCenterJust = $00000001;
  60. popupTitleRightJust = $000000FF;
  61.  
  62. {
  63. axis constraints for DragGrayRgn call}
  64. noConstraint = 0;
  65. hAxisOnly = 1;
  66. vAxisOnly = 2;
  67.  
  68. {
  69. control messages}
  70. drawCntl = 0;
  71. testCntl = 1;
  72. calcCRgns = 2;
  73. initCntl = 3;
  74. dispCntl = 4;
  75. posCntl = 5;
  76. thumbCntl = 6;
  77. dragCntl = 7;
  78. autoTrack = 8;
  79. calcCntlRgn = 10;
  80. calcThumbRgn = 11;
  81.  
  82. cFrameColor = 0;
  83. cBodyColor = 1;
  84. cTextColor = 2;
  85. cThumbColor = 3;
  86. popupMenuCDEFproc = popupMenuProc;    { synonym for compatibility }
  87.  
  88. TYPE
  89. ControlPtr = ^ControlRecord;
  90. ControlHandle = ^ControlPtr;
  91. ControlRecord = PACKED RECORD
  92.  nextControl: ControlHandle;
  93.  contrlOwner: WindowPtr;
  94.  contrlRect: Rect;
  95.  contrlVis: Byte;
  96.  contrlHilite: Byte;
  97.  contrlValue: INTEGER;
  98.  contrlMin: INTEGER;
  99.  contrlMax: INTEGER;
  100.  contrlDefProc: Handle;
  101.  contrlData: Handle;
  102.  contrlAction: ProcPtr;
  103.  contrlRfCon: LONGINT;
  104.  contrlTitle: Str255;
  105.  END;
  106.  
  107. CCTabPtr = ^CtlCTab;
  108. CCTabHandle = ^CCTabPtr;
  109. CtlCTab = RECORD
  110.  ccSeed: LONGINT;                    {reserved}
  111.  ccRider: INTEGER;                    {see what you have done - reserved}
  112.  ctSize: INTEGER;                    {usually 3 for controls}
  113.  ctTable: ARRAY [0..3] OF ColorSpec;
  114.  END;
  115.  
  116. AuxCtlPtr = ^AuxCtlRec;
  117. AuxCtlHandle = ^AuxCtlPtr;
  118. AuxCtlRec = RECORD
  119.  acNext: AuxCtlHandle;                {handle to next AuxCtlRec}
  120.  acOwner: ControlHandle;            {handle for aux record's control}
  121.  acCTable: CCTabHandle;                {color table for this control}
  122.  acFlags: INTEGER;                    {misc flag byte}
  123.  acReserved: LONGINT;                {reserved for use by Apple}
  124.  acRefCon: LONGINT;                    {for use by application}
  125.  END;
  126.  
  127.  
  128. FUNCTION NewControl(theWindow: WindowPtr;boundsRect: Rect;title: Str255;
  129.  visible: BOOLEAN;value: INTEGER;min: INTEGER;max: INTEGER;procID: INTEGER;
  130.  refCon: LONGINT): ControlHandle;
  131.  INLINE $A954;
  132. PROCEDURE SetCTitle(theControl: ControlHandle;title: Str255);
  133.  INLINE $A95F;
  134. PROCEDURE GetCTitle(theControl: ControlHandle;VAR title: Str255);
  135.  INLINE $A95E;
  136. FUNCTION GetNewControl(controlID: INTEGER;owner: WindowPtr): ControlHandle;
  137.  INLINE $A9BE;
  138. PROCEDURE DisposeControl(theControl: ControlHandle);
  139.  INLINE $A955;
  140. PROCEDURE KillControls(theWindow: WindowPtr);
  141.  INLINE $A956;
  142. PROCEDURE HideControl(theControl: ControlHandle);
  143.  INLINE $A958;
  144. PROCEDURE ShowControl(theControl: ControlHandle);
  145.  INLINE $A957;
  146. PROCEDURE DrawControls(theWindow: WindowPtr);
  147.  INLINE $A969;
  148. PROCEDURE Draw1Control(theControl: ControlHandle);
  149.  INLINE $A96D;
  150. PROCEDURE HiliteControl(theControl: ControlHandle;hiliteState: INTEGER);
  151.  INLINE $A95D;
  152. PROCEDURE UpdtControl(theWindow: WindowPtr;updateRgn: RgnHandle);
  153.  INLINE $A953;
  154. PROCEDURE UpdateControls(theWindow: WindowPtr;updateRgn: RgnHandle);
  155.  INLINE $A953;
  156. PROCEDURE MoveControl(theControl: ControlHandle;h: INTEGER;v: INTEGER);
  157.  INLINE $A959;
  158. PROCEDURE SizeControl(theControl: ControlHandle;w: INTEGER;h: INTEGER);
  159.  INLINE $A95C;
  160. PROCEDURE SetCtlValue(theControl: ControlHandle;theValue: INTEGER);
  161.  INLINE $A963;
  162. FUNCTION GetCtlValue(theControl: ControlHandle): INTEGER;
  163.  INLINE $A960;
  164. PROCEDURE SetCtlMin(theControl: ControlHandle;minValue: INTEGER);
  165.  INLINE $A964;
  166. FUNCTION GetCtlMin(theControl: ControlHandle): INTEGER;
  167.  INLINE $A961;
  168. PROCEDURE SetCtlMax(theControl: ControlHandle;maxValue: INTEGER);
  169.  INLINE $A965;
  170. FUNCTION GetCtlMax(theControl: ControlHandle): INTEGER;
  171.  INLINE $A962;
  172. PROCEDURE SetCRefCon(theControl: ControlHandle;data: LONGINT);
  173.  INLINE $A95B;
  174. FUNCTION GetCRefCon(theControl: ControlHandle): LONGINT;
  175.  INLINE $A95A;
  176. PROCEDURE SetCtlAction(theControl: ControlHandle;actionProc: ProcPtr);
  177.  INLINE $A96B;
  178. FUNCTION GetCtlAction(theControl: ControlHandle): ProcPtr;
  179.  INLINE $A96A;
  180. PROCEDURE DragControl(theControl: ControlHandle;startPt: Point;limitRect: Rect;
  181.  slopRect: Rect;axis: INTEGER);
  182.  INLINE $A967;
  183. FUNCTION TestControl(theControl: ControlHandle;thePt: Point): INTEGER;
  184.  INLINE $A966;
  185. FUNCTION TrackControl(theControl: ControlHandle;thePoint: Point;actionProc: ProcPtr): INTEGER;
  186.  INLINE $A968;
  187. FUNCTION FindControl(thePoint: Point;theWindow: WindowPtr;VAR theControl: ControlHandle): INTEGER;
  188.  INLINE $A96C;
  189. PROCEDURE SetCtlColor(theControl: ControlHandle;newColorTable: CCTabHandle);
  190.  INLINE $AA43;
  191. FUNCTION GetAuxCtl(theControl: ControlHandle;VAR acHndl: AuxCtlHandle): BOOLEAN;
  192.  INLINE $AA44;
  193. FUNCTION GetCVariant(theControl: ControlHandle): INTEGER;
  194.  INLINE $A809;
  195.  
  196.  
  197. {$ENDC} { UsingControls }
  198.  
  199. {$IFC NOT UsingIncludes}
  200.  END.
  201. {$ENDC}
  202.  
  203.